function openModal(id) {
	$(function() {
		$("#" + id).modal();
	});
}

function closeModal(id) {
	$('#' + id).modal('hide')
}
function checkChar(e, area) {
	var textarea = document.getElementById("brick-textarea")
	var counter = document.getElementById("counterChar")
	if (e.keyCode == 8) {
		if(textarea.value.length == 0) {
			counter.innerHTML = 130
		}
		else
		counter.innerHTML = parseInt(document.getElementById("counterChar").innerHTML) + 1
	}
	else if(counter.innerHTML==0 & e.keyCode != 8) {
		return false;
	}
	else counter.innerHTML = parseInt(document.getElementById("counterChar").innerHTML) - 1
}